<?php
session_start();
require_once dirname(dirname(__FILE__)) . '/shared/libraries/lib_redirect.php';

$time_out = 60;
if(empty($_SESSION['timeout'])){
    $_SESSION['timeout'] = time();
} else {
    $inactive_time = time() - $_SESSION['timeout'];
    if($inactive_time > $time_out){
        $_SESSION['timeout'] = time();
    }
}

if (empty($_SESSION['user_login']) || $_SESSION['user_login'] === 'failed') {
    lib_redirect::Redirect('/login.php');
}
